Skip to content

Conversation

@rragundez
Copy link
Contributor

@rragundez rragundez commented Oct 22, 2025

Add CORS middleware by default as it is best practice. Then make it flexible in order for the user to follow advice in docs when in staging or production and instead of going into the source code, manipulate the CORS origins, methods and headers via the environment variables.

NOTE: I have not tested fully this change. I can do it tomorrow or if you can help validate, that would be great.

@rragundez rragundez changed the title [WIP] Add CORS middleware and update documentation Add CORS middleware and update documentation Oct 22, 2025
@igorbenav
Copy link
Collaborator

@LucasQR test this one when possible

@igorbenav igorbenav requested a review from LucasQR November 4, 2025 00:26
@rragundez
Copy link
Contributor Author

@LucasQR test this one when possible

if it helps I have been using already

@igorbenav
Copy link
Collaborator

@rragundez looks great! Can you please just update the readme (we changed the structure a lot), add example in the .env.example and maybe also in the docs? Then I can merge

@LucasQR
Copy link
Collaborator

LucasQR commented Nov 17, 2025

I'll make the requested changes and test the code a bit more so it can be merged

@LucasQR LucasQR merged commit 62a56f1 into benavlabs:main Nov 17, 2025
3 checks passed
@rragundez
Copy link
Contributor Author

I'll be adding a PR for environment variables of the backend and frontend host, this will make it easier for the user to specify the origins without hardcoding in the source code. In addition i also need these env variables for defining the redirect URLS when using oauth, and they are handy for other uses in an application backend.

@rragundez rragundez deleted the cors-middleware branch November 18, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants